package com.zeroup.auto.utils;

import android.app.Activity;
import android.database.Cursor;
import android.net.Uri;

import com.alibaba.fastjson.JSON;
import com.zeroup.auto.bean.MGanVideo;


public class ApplicationUtiles {

    private static String uri = "content://video/last";

    public static  Activity activity;

    public static void setActivity(Activity activity) {
        ApplicationUtiles.activity = activity;
    }

    public static MGanVideo get(){
        Cursor cursor = ApplicationUtiles.activity.getContentResolver().query(Uri.parse(uri), null, null, null, null);
        if(cursor !=null && cursor.moveToNext()){
            String json = cursor.getString(1);
            return JSON.parseObject(json, MGanVideo.class);
        }
        return null;
    }
}
